<template>
  <div>
    <div id="app">
        <router-view  />
    </div>
  </div>
</template>

<script>
  import UserApi from '@/api/user.js'
export default {
  name: 'App',
  created() {
    var timer = setInterval(() => {
      //判断登陆失效没
      if(this.Authorization != ''){
        UserApi.LoginStatus().then(response => {
          // 失效
          if(response.data === false){
             //移除localStorage
             //删除本地UserInfo
             localStorage.removeItem("Authorization")
             localStorage.removeItem("UserInfo")
             this.$message({
               showClose: true,
               message:"您的账号在别处登陆",
               type:'error',
               center: true,
               duration: 3000
             })
             this.$router.go(0)
             this.$router.push({
               path:'/user/login'
             })
          }
        })
      }
    },600000)
  }
}
</script>

<style>
/*  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
  } */

 html{
    margin: 0;
    padding: 0;
    /* background-color: #F5F7FA; */
    /* background-color: #000000; */
    /* color: #FFFFFF; */
  }
  a{
    text-decoration: none;
  }
  body{
    min-width: 1200px;
  }
</style>
